package tool;

import java.util.ArrayList;

public class Coordinate{
	
	private double x;
	private double y;
	private int ageCount;
	private int frequencyCount;
	
	public Coordinate(double pX,double pY,int pAge){
		this.x = pX; this.y=pY; this.ageCount = pAge; this.frequencyCount=1;
	}

	public double getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}
	
	public boolean equals(Coordinate c){
		return (c.getX()==this.getX())&&(c.getY()==this.getY());		
	}
	
	public void update(int age){
		ageCount = ageCount + age; frequencyCount = frequencyCount+1;
	}
	
	public String toString(){
		return x+" "+y+" "+frequencyCount+" "+ageCount;
	}
	
	public static void main(String args[]){
		Coordinate c = new Coordinate(1,1,1);
		Coordinate c2 = new Coordinate(1,1,2);
		System.out.println(c.equals(c2));
	}
}